#! /usr/bin/env python

import pygame
from pygame.locals import *

import pygame_svg as svg

if __name__ == '__main__':
    pygame.init ()
    screen = pygame.display.set_mode ((640, 480), DOUBLEBUF, 32)
    
    print 'SDL_svg Version:', svg.version ()
    
    obj = svg.Context ('tux.svg')
    obj.set_offset (obj.width * 0.5, obj.height * 0.5)
    obj.set_scale (640 / obj.width, 480 / obj.height)
    
    running = True
    
    while running:
        for event in pygame.event.get ():
            if event.type == QUIT:
                running = False
        
        screen.fill ((0, 0, 0, 0))
        obj.to_surface (320, 240, screen)
        
        pygame.display.flip ()
    
    pygame.quit ()
